package com.baihui.taobao.action;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;

import com.baihui.taobao.record.PayUser;
import com.opensymphony.xwork2.ActionSupport;

public class LoadPayUserAction extends ActionSupport {

	private static final long serialVersionUID = 7803674731599166199L;
	public List<PayUser> payUserList = new ArrayList<PayUser>();
	public String userType = "";

	public String getUserType() {
		return userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	public List<PayUser> getPayUserList() {
		return payUserList;
	}

	public void setPayUserList(List<PayUser> payUserList) {
		this.payUserList = payUserList;
	}

	@Override
	public String execute() throws Exception {
		HttpServletRequest request = ServletActionContext.getRequest();

		// String db = request.getRealPath("/WEB-INF/db.properties");
		// DBConnectionMgr.init(db);
		payUserList = PayUser.findAll(userType);
		return SUCCESS;
	}

}
